package com.example.musicapp.model;

import com.example.musicapp.base.BaseModel;
import com.example.musicapp.contract.ISearchContract;
import com.example.musicapp.network.HttpResponseListener;
import com.example.musicapp.utils.HttpUtils;

public class SearchModel extends BaseModel implements ISearchContract.ISearchModel {
    @Override
    public void search(String searchThing, int curPage, HttpResponseListener callBack) {
        String url = "http://music.gochiusa.top/cloudsearch?keywords=" + searchThing + "&offset=" + (curPage - 1) * 20;
        HttpUtils.sendHttpRequest(url, callBack);
    }

    @Override
    public void requestHotWord(HttpResponseListener callBack) {
        HttpUtils.sendHttpRequest("http://music.gochiusa.top/search/hot", callBack);
    }
}
